package top.lyc829.leetcode.T215;

import java.lang.reflect.Array;
import java.util.*;


public class Solution {
    public int findKthLargest(int[] nums, int k) {

        List<Integer> list = new ArrayList<Integer>();
        for (int num : nums) {
            list.add(num);
        }

        list.sort(Collections.reverseOrder());

        return list.get(k - 1);


    }

    public static void main(String[] args) {
        Solution solution = new Solution();
        int res = solution.findKthLargest(new int[] {3,2,1,5,6,4}, 2);
        System.out.println(res);
    }

}
